<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-6">
            <h1 class="page-header">浙江日报——报卡管理</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>	
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <form id="zjdailyCard" name="zjdailyCard" method="get" class="placedInline"> 
						<a type="button" href="{:U('User/ZJDailyCard/generate')}" class="btn btn-sm btn-warning dword-size">生成</a>
                        <button type="submit" formaction="{:U('User/ZJDailyCard/download')}" formmethod="post" class="btn btn-sm btn-success dword-size">数据导出</button>
						<button type="button" formaction="{:U('User/ZJDailyCard/delete')}" formmethod="post" class="btn btn-sm btn-danger dword-size" id="submitDeleteBtn">删除</button>
                        <div class="pull-right">
                            <label for="status">状态</label>
                            <select name="status">
                                <option value="3" <if condition="$search['status'] eq 3">selected="selected" </if> >已激活</option>
                                <option value="2" <if condition="$search['status'] eq 2">selected="selected" </if> >已激活，已导出</option>
                                <option value="1" <if condition="$search['status'] eq 1">selected="selected" </if> >已激活，未导出</option>
                                <option value="-1" <if condition="$search['status'] eq -1">selected="selected" </if> >未激活</option>
                            </select>

                            <label for="distributionyear">年份</label>
                            <select name="distributionyear">
                                <for start="-3" end="4">
                                <php>
                                    $year = date('Y') + $i + 1;
                                </php>
                                <option value="{$year}" <if condition="$search['distributionyear'] eq $year">selected = "selected"</if> >{$year}</option>
                                </for>
                                <!-- <option value="2017" <if condition="$search['distributionyear'] eq 2017">selected = "selected"</if> >2017</option>
                                <option value="2016" <if condition="$search['distributionyear'] eq 2016">selected = "selected"</if> >2016</option>
                                <option value="2015" <if condition="$search['distributionyear'] eq 2015">selected = "selected"</if> >2015</option> -->
                            </select>
                            <button type="submit" formaction="{:U('User/ZJDailyCard/index')}" formmethod="post" class="font-sm" >搜索</button>
                        </div>
					</form>
                </div>
                <!-- /.panel-heading -->
	                <div class="panel-body">
                        <div class="col-lg-12">
	                        <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th><input type="checkbox" data-action="checkboxAll"></th>
                                            <th>卡号</th>
                                            <th>状态</th>
                                            <th>激活时间</th>
                                            <th>发行年份</th>
                                            <th>用户姓名</th>
                                            <th>手机号码</th>
                                            <th>城市</th>
                                            <th>县区</th>
                                            <th>地址</th>
                                            <th>职业</th>
                                            <th class="textAlignCenter">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
	                                    <volist name="list" id="card">
	                                        <tr>
	                                            <td><input type="checkbox" data-action="checkboxOnce"  name="items[]" value="{$card['id']}" form="zjdailyCard" class="items"></td>
	                                            <td>{$card.cardnumber}</td>
	                                            <td>
                                                    <if condition="$card.status eq -1">
                                                    未激活
                                                    <elseif condition="$card.status eq 1" />
                                                    已激活，未导出
                                                    <elseif condition="$card.status eq 2" />
                                                    已激活，已导出
                                                    </if>
                                                </td>
	                                            <td>{$card.signtime}</td>
	                                            <td>{$card.distributionyear}</td>
	                                            <td>{$card.username}</td>
                                                <td>{$card.telephone}</td>
                                                <td>{$card.city}</td>
                                                <td>{$card.county}</td>
                                                <td>{$card.address}</td>
                                                <td>{$card.metier}</td>
	                                            <td>
                                                    <a href="{:U('User/ZJDailyCard/edit?id='.$card['id'])}" class="btn btn-success">编辑</a>
	                                            </td>
	                                        </tr>
	                                    </volist>
                                    </tbody>
                                </table>
                            </div>
                            <!-- /.table-responsive -->
	                        <div class="pages">
	                        	{$page}
	                        </div>
                    	</div>
                        <!-- / .col-lg-12 -->
	                </div>
	                <!-- / .panel-body -->
                </div>
                <!-- /.panel-body -->
            </div>
            <!-- /.panel -->
        </div>
        <!-- /.col-lg-12 -->
    </div>	
</div>
<import type="js" file="common" basepath="/Public/js" />
<script type="text/javascript">
	common.multiSelect.init( "checkboxAll", "checkboxOnce" );
</script>
<script src="/Public/js/zjdailyCard/page.zjdailyCard.js" type="text/javascript"></script>
<script type="text/javascript">
page.zjdailyCard.delete.init({
        trigger: "#submitDeleteBtn",
        httpRes: "{:U('User/ZJDailyCard/delete')}",
        items: ".items",
        successCallback: function(){
            window.alert( "删除成功" );
            window.location.reload( true );
        },
        failCallback: function(){
            window.alert( "删除失败" );
        },
        errorCallback: function(){
            window.alert( "删除出错" );
        }
});
</script>
